/*
base on jquery
@:ly
*/
$(function(){
	//menu
	var $menu =$(".menu");
	var $curr = $("<span class='current'></span>").appendTo($menu);
	
	$menu.find("li",this).mouseover(function(){
			move(this);												  
		});
	function move(a){
		   $.dequeue(this,"fx");
			$curr.stop().animate({width:a.offsetWidth,
							  left:a.offsetLeft
							  });
	}
	//menu over
	
	//tab选项卡切换js
	$(".tab").each(function(){
		$(this).find(".tabCurr li:first").addClass("focus");
		$(this).find(".boxs::first").show();
		
		$(this).find(".tabCurr li").mouseover(function(){
			var index =$(this).index();															  
			$(this).addClass("focus").siblings().removeClass("focus");
			$(this).parent().siblings(".tabox").find(".boxs:eq("+index+")").show().siblings(".boxs").hide();
		});
	});
	
	//快速预定 实现预定数量加减
	$(".btnMinus").click(function(){
			var defaultValue =parseInt($(this).siblings(".num").val());
			var value = defaultValue-1;
			if(value<=1){
				value=1;
				}
			$(this).siblings(".num").val(value);								
	});
	$(".btnAdd").click(function(){
			var defaultValue =parseInt($(this).siblings(".num").val());
			var value = defaultValue+1;
			$(this).siblings(".num").val(value);
	});
		
	
	//内页搜索仿select
	$(".inSearch").find(".select").hover(function(){												 
			var txt = $(this).find(".input");
		if($(this).find(".dropSelect").length>0)
		{
		$(this).find(".dropSelect").show();
		$(this).find(".dropSelect a").click(function(){
			var currValue = $(this).html();
			txt.val(currValue);
		});
		}
		if($(this).find(".dropScenic").length>0){
				$(this).find(".dropScenic").show()
				$(this).find(".dropScenic a").click(function(){
				var currValue = $(this).html();
				txt.val(currValue);
				$(this).parents(".dropScenic").hide();
		});
			}
	},function(){
		if($(this).find(".dropSelect").length>0){
		$(this).find(".dropSelect").hide();
		}
		if($(this).find(".dropScenic").length>0){
		$(this).find(".dropScenic").hide();
		}
		});
	//演员预订特约演员表单效果
	$(".speActor").live("click",function(){
			$(".speAct").show(); 
	 });
	$(".normalActor").live("click",function(){	
				$(".speAct").hide(); 
	 });
	//演出节目清单类漂浮按钮
	 $SideScroll =$(".sidekf");
 	$(window).scroll(function(){
		var offsetValue = $(window).scrollTop();
		$SideScroll.stop().animate({top:100+offsetValue});
	});
	var timer;
	$SideScroll.mouseover(function(){
		clearTimeout(timer);						   
		$(this).find(".sidekfContainer").show()
	});
	$SideScroll.mouseout(function(){
		var $this=$(this);
		timer = setTimeout(function(){
			$this.find(".sidekfContainer").hide();							
		},400);
	});
	//changeMailAndPhone
	$(".btnchange").click(function(){
	$(this).hide().next(".Confirmed").show().parents(".para")
		.find(".changeInput").attr("readonly",false).css({"border":"1px #ccc solid",
														 "background":"#fff",
														 "height":"24px"
														 }).focus();							   
	});
});

/**导航焦点函数*/
function defaultCurr(n){
		$(".menu").find("li:eq("+n+")").trigger("mouseover");	
	}
function cartData(){
	var offsetTop = $(window).height();
	var winHeight = $(".cartWin").height();
	var scrollHeight= $(window).scrollTop();
	$(".cartWin").css("top",(offsetTop-winHeight)/2+scrollHeight)
	$(".cartWin").load("ajax/cartData.html").show();	
	}
function cartData2(){
	var offsetTop = $(window).height();
	var winHeight = $(".cartWin").height();
	var scrollHeight= $(window).scrollTop();
	$(".cartWin").css("top",(offsetTop-winHeight)/2+scrollHeight)
	$(".cartWin").load("ajax/cartData2.html").show();	
	}
function cartData3(){
	var offsetTop = $(window).height();
	var winHeight = $(".cartWin").height();
	var scrollHeight= $(window).scrollTop();
	$(".cartWin").css("top",(offsetTop-winHeight)/2+scrollHeight)
	$(".cartWin").load("ajax/cartData3.html").show();	
	}
function cartData4(){
	var offsetTop = $(window).height();
	var winHeight = $(".cartWin").height();
	var scrollHeight= $(window).scrollTop();
	$(".cartWin").css("top",(offsetTop-winHeight)/2+scrollHeight)
	$(".cartWin").load("ajax/cartData4.html").show();	
	}
function cartData5(){
	var offsetTop = $(window).height();
	var winHeight = $(".cartWin").height();
	var scrollHeight= $(window).scrollTop();
	$(".cartWin").css("top",(offsetTop-winHeight)/2+scrollHeight)
	$(".cartWin").load("ajax/cartData5.html").show();	
	}
function closeData(){
	$(".cartWinBox").remove();
	$(".cartWin").hide();
	}		
	